package com.fu.web.controler;

import com.alibaba.fastjson.JSON;
import com.fu.web.DTO.*;
import com.fu.web.service.docVueService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/doc")
public class docVueControler {
    @Autowired
     private docVueService dap;
//展示未就诊患者
    @GetMapping("/showUn")
    public @ResponseBody String showUn(){
        List<unOveredpatient> unOveredpatients = dap.showUn();
        String str= JSON.toJSONString(unOveredpatients);
        return str;
    }
//    展示已经就诊患者
    @GetMapping("/showEn")
    public @ResponseBody String showEn(){
        List<overedPatient> overedPatients = dap.showEN();
        String str= JSON.toJSONString(overedPatients);
        return str;
    }
//提交诊断表
    @PostMapping("/healingForm")
    public void healingForm(@RequestBody descBookVue descBookVue){
        dap.processDescbook(descBookVue);

    }
//    展示处方
    @GetMapping("/showPre")
    public @ResponseBody String  showPre(){
        List<presVue> presVues = dap.processPre();
        String str=JSON.toJSONString(presVues);
        return str ;
    }
//    提供药物 创建处方
    @GetMapping("/showDrug")
    public @ResponseBody String showDrug(){
        List<showDrug> showDrugs = dap.showDrug();
        String temp=JSON.toJSONString(showDrugs);
        return temp;
    }

//    创建处方
    @PostMapping("/createPre")
    public void createPre(@RequestBody addPreVue addPreVue ){
        dap.addPre(addPreVue);

    }

    public static void main(String[] args) {

    }




}
